
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'GWoDeDingDan.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
    <link rel="stylesheet" href="css/Gwodedingdan.css" type="text/css">
    <script src="js/jquery-1.8.3.js"></script>
    <script type="text/javascript" src="js/laydate/laydate.js "></script>
    <script src="js/ZhiFuDingDan.js"></script>
  </head>
  
  <body>
    <div class="kuan1000">
    <div class="baifenbai">
        <div class="jianbian">
            <div>我的订单</div>
            <form action="gwodedingdan.do" id="form1">
            	<div class="youfu">
	                <select name="zhuangtai" id="zhuangtai">
                		<option value="quan">全部状态</option>
	                    <option value="1">未付款</option>
	                    <option value="2">准备发货</option>
	                    <option value="3">已发货</option>
	                    <option value="4">已签收</option>
	                </select>
	                <input type="hidden" id="yinchang1" value="${zhuangtai }">
	            </div>
            	
            
	            <div class="youfu">
	                <input type="text" name="shijian1" id="shijian1" value="${shijian1 }" /> 到 <input type="text" name="shijian2" id="shijian2" value="${shijian2 }">
	                <input type="submit" value="查询">
	            </div>
            </form>
            <div>
			
            </div>
        </div>
        <div class="xia">
        	<c:forEach items="${list }" var="a">
	            <table border="0px" cellspacing="0px" cellspacing="0" style="width:100%" >
	            	<thead>
	            		<tr>
	            			<th>&nbsp;&nbsp; ${a.orderdate }</th>
	            			<th>订单号：${a.orderii }</th>
	            			<th>单价</th>
	            			<th>数量</th>
	            			<th>商品操作</th>
	            			<th>应付金额</th>
	            			<th>查看详情></th>
	            		</tr>
	            	</thead>
	            	<tbody>
		            		<c:forEach items="${a.orderid }" var="b" varStatus="row">
		            		 	<c:if test="${row.count==1}"> 
			            		 	<tr>
				            			<td><img src="${b.gouwuche.tu }" width="50px" height="50px"></td>
				            			<td>${b.gouwuche.ming }</td>
				            			<td>￥<span style="color:red">${b.gouwuche.money }</span></td>
				            			<td>${b.gouwuche.sum }</td>
				            			<td>${b.gouwuche.zhongjia }</td>
				            			<td rowspan="${a.orderid.size() }" style="vertical-align:top;">￥<span style="color:red">${a.total }</span></td>
				            			<c:choose>
				            				<c:when test="${a.zhuangid==1 }"><td rowspan="${a.orderid.size() }" style="vertical-align:top;">未付款 <a id="fukuan" href="fukuan.do?id=${a.orderii }">去付款</a></td></c:when>
				            				<c:when test="${a.zhuangid==2 }"><td rowspan="${a.orderid.size() }" style="vertical-align:top;">准备发货</td></c:when>
				            				<c:when test="${a.zhuangid==3 }"><td rowspan="${a.orderid.size() }" style="vertical-align:top;">已发货</td></c:when>
				            				<c:when test="${a.zhuangid==4 }"><td rowspan="${a.orderid.size() }" style="vertical-align:top;">已签收</td></c:when>
				            			
				            			</c:choose>
				            			
			            			</tr>
		            			</c:if>
		            			<c:if test="${row.count!=1}"> 
			            			<tr>
				            			<td><img src="${b.gouwuche.tu }" width="50px" height="50px"></td>
				            			<td>${b.gouwuche.ming }</td>
				            			<td>￥<span style="color:red">${b.gouwuche.money }</span></td>
				            			<td>${b.gouwuche.sum }</td>
				            			<td>${b.gouwuche.zhongjia }</td>
				            		</tr>
		            			</c:if>
		            			
		            		</c:forEach>
	            	</tbody>
	            </table>
	            <br>
	            <hr>
	            <br>
            </c:forEach>
        </div>
    </div>
</div>

	<script type="text/javascript">
	    $(function(){
	    	$("#zhuangtai").val($("#yinchang1").val());
	    	$("#zhuangtai").change(function(){
	    		$('#form1').trigger('submit');
	    	})
	    })
	    laydate.render({
  			elem: '#shijian1' //指定元素
		});
		laydate.render({
  			elem: '#shijian2' //指定元素
		});
		
	    
    </script>


  </body>
</html>
